adpat move_intermediate_cache for sglang prefix + mtp#422
Merged
RuixuanZhang06 merged 2 commits intosgl-project:mainfrom Apr 3, 2026
Merged
adpat move_intermediate_cache for sglang prefix + mtp#422RuixuanZhang06 merged 2 commits intosgl-project:mainfrom
RuixuanZhang06 merged 2 commits intosgl-project:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request decouples source and destination indices in the Mamba state update Triton kernel and its wrapper function, allowing for more flexible cache movement. Previously, a single index tensor was used for both source and destination. Feedback suggests strengthening input validation by asserting that all index tensors (dst_indices_tensor, src_indices_tensor, and last_steps_tensor) have matching lengths and ensuring they are contiguous int32 tensors to prevent potential out-of-bounds access or type mismatches in the Triton kernel.
python/sgl_kernel_npu/sgl_kernel_npu/mamba/mamba_state_update_triton.py
Outdated
Show resolved
Hide resolved
5 tasks
RuixuanZhang06
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dependence
sgl-project:
Ascend/sglang#202